package com.java.mytools.controller;

import com.java.mytools.common.base.entity.RespMessage;
import com.java.mytools.service.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author wangning
 * @create 2021-09-03 15:45
 */
@Api("用户")
@Controller
@RequestMapping("/user")
public class SysUserController {
	private static final Logger logger = LoggerFactory.getLogger(SysUserController.class);

	@Autowired
	private SysUserService sysUserService;

	@GetMapping("/findAll")
	@ResponseBody
	@ApiOperation("查询所有机构")
	public RespMessage findAll() {
//		System.out.println("修改，测试热部署");
		logger.info("查询成功 branch:{}",sysUserService.findAll());
		return RespMessage.ok(sysUserService.findAll());
	}

	@GetMapping("/list")
	@ResponseBody
	@ApiOperation("查询所有机构")
	public RespMessage findSysUserList() {
		logger.info("查询成功 branch:{}",sysUserService.findSysUserList());
		return RespMessage.ok(sysUserService.findSysUserList());
	}

	@ApiOperation("导出 excel")
	@PostMapping("/export/excel")
	public void excelDownload() {

	}
}
